<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script>var weburl = '{yun:}$config.sy_weburl{/yun}';</script>
<script src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.0.min.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="js/admin_public.js?v={yun:}$config.cachecode{/yun}" language="javascript"></script>
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/phpyun_layer.js?v={yun:}$config.cachecode{/yun}"></script>

<script language="javascript">
function news_preview(url){
	$(".job_box_div").html("<img src='"+url+"' style='max-width:500px' />");//
 	$.layer({
		type : 1,
		title : '查看图片',
		closeBtn : [0 , true],
		offset : ['20%' , '30%'],
		border : [10 , 0.3 , '#000', true],
		area : ['560px','auto'],
		page : {dom : '#news_preview'}
	}); 
}
function checkform(myform){
	if ($("#nid").val()=="") {
		parent.layer.msg('请选择新闻类别！', 2,8);return false;
	}
	if ($("#title").val()=="") {
		parent.layer.msg('请填写新闻标题！', 2,8);return false;
	}
	var content = UE.getEditor('myEditor').getContent();
	if (content=="") {
		parent.layer.msg('请填写新闻内容！', 2,8);return false;
	}
	loadlayer();
	$("#newsform").submit();
}
</script>
<link href="images/reset.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/system.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />
<link href="images/table_form.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css" />

<title>后台管理</title>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.config.js?v={yun:}$config.cachecode{/yun}"></script>
<script src="{yun:}$config.sy_weburl{/yun}/js/ueditor/ueditor.all.min.js?v={yun:}$config.cachecode{/yun}"></script> 
</head>
<body class="body_ifm">
<div class="infoboxp"> 
<div class="admin_new_tip">
<a href="javascript:;" class="admin_new_tip_close"></a>
<a href="javascript:;" class="admin_new_tip_open" style="display:none;"></a>
<div class="admin_new_tit"><i class="admin_new_tit_icon"></i>操作提示</div>
<div class="admin_new_tip_list_cont">
<div class="admin_new_tip_list">管理员根据自己运营需求自由添加新闻！添加新闻内容（针对新闻的标题、关健词和简短描述）进行SEO角度去设置！可以提升搜索引擎对网站收录友好度。</div>
</div>
</div>


  <div class="clear"></div>
  <div class="tag_box mt10">
    <iframe  id="supportiframe"  name="supportiframe" onload="returnmessage('supportiframe');" style="display:none"></iframe>
    <form id="newsform" name="myform" target="supportiframe" action="index.php?m=admin_news&c=addnews" method="post" encType="multipart/form-data" class="layui-form">
      <table width="100%" class="table_form">
       <tr >  
       <tbody>
          <th bgcolor="#f0f6fb" colspan="2" ><span class="admin_bold">添加新闻</span></th>
            </tbody>
            </tr >
        <tr >
     
          <th width="120">新闻类别：</th>
          <td>
            <div class="layui-input-inline">
		      <select id="nid" name="nid">
			    {yun:}if $info.nid{/yun}
		 		  {yun:}foreach item=v from=$one_class{/yun}
	                    {yun:}if $v.id eq $info.nid{/yun}
	                    <option value="{yun:}$v.id{/yun}" selected>{yun:}$v.name{/yun}</option>
	                    {yun:}else{/yun}
	                    <option value="{yun:}$v.id{/yun}" >{yun:}$v.name{/yun}</option>
	                    {yun:}/if{/yun}
	                    {yun:}foreach item=val from=$two_class[$v.id]{/yun}
	                        {yun:}if $val.id eq $info.nid{/yun}
	                        <option value="{yun:}$val.id{/yun}" selected>{yun:}$val.name{/yun}</option>
	                        {yun:}else{/yun}
	                    	<option value="{yun:}$val.id{/yun}" > 　┗{yun:}$val.name{/yun}</option>
	                        {yun:}/if{/yun}
	                    {yun:}/foreach{/yun}
	                {yun:}/foreach{/yun}
	            {yun:}else{/yun}
	                <option value="">请选择</option>
	            {yun:}/if{/yun}
		        
		        {yun:}if !$info.nid{/yun}
			        {yun:}foreach item=v from=$one_class{/yun}
	                <option value="{yun:}$v.id{/yun}">{yun:}$v.name{/yun}</option>
	                	  {yun:}foreach item=val from=$two_class[$v.id]{/yun}
	                           <option value="{yun:}$val.id{/yun}"> 　┗{yun:}$val.name{/yun}</option>
	                      {yun:}/foreach{/yun}                    
	                {yun:}/foreach{/yun}
                {yun:}/if{/yun}
                
		      </select>
		    </div>
            
         <a href="index.php?m=admin_news&c=group" class="layui-btn layui-btn-normal">添加分类</a></td>
        </tr>
        <tr class="admin_table_trbg" >
          <th>新闻标题：</th>
          <td>
          	
          <div class="layui-form-item">
            <div class="layui-input-block">
            <div class="layui-input-inline">
              <input type="text" name="title" id="title" size="60" lay-verify="required" value="{yun:}$info.title{/yun}" style="display:inline;width:400px;" autocomplete="off" class="layui-input">
            </div>
            </div>
          </div>
          </td>
        </tr>
        <tr class="admin_table_trbg" >
          <th>作　　者：</th>
          <td>
          
          <div class="layui-form-item">
            <div class="layui-input-block">
            <div class="layui-input-inline">
              <input type="text" name="author" id="author"  lay-verify="required" value="{yun:}$info.author{/yun}" size="60"  autocomplete="off" class="layui-input" style="display:inline;width:400px;">
              </div>
            </div>
          </div>
          
          </td>
        </tr>
        <tr >
          <th>来　　源：</th>
          <td>
          <div class="layui-form-item">
            <div class="layui-input-block">
            <div class="layui-input-inline">
              <input type="text" name="source" id="source"  lay-verify="required" value="{yun:}$info.source{/yun}" size="60"  autocomplete="off" class="layui-input" style="display:inline;width:400px;">
              </div>
            </div>
          </div>
          </td>
        </tr>
        <tr class="admin_table_trbg" >
          <th>关 键 词：</th>
          <td>
          <div class="layui-form-item">
            <div class="layui-input-block">
            <div class="layui-input-inline">
              <input type="text" name="keyword" id="keyword"  lay-verify="required" value="{yun:}$info.keyword{/yun}" size="60"  autocomplete="off" class="layui-input" style="display:inline;width:400px;">
              </div>
              <span class="admin_web_tip">多个关键字，请用,隔开</span>
              
            </div>
          </div>
            </td>
        </tr>
        <tr >
          <th>描　　述：</th>
          <td>
          
          <div class="layui-form-item">
            <div class="layui-input-block">
              <textarea name="description" cols="60" rows="3" class="admin_comdit_textarea web_text_textarea"  style="display:inline;width:390px;">{yun:}$info.description{/yun}</textarea>
            </div>
          </div>
          
          </td>
        </tr>
        <tr class="admin_table_trbg" >
          <th>新闻内容： </th>
          <td>
 		  <script id="myEditor" name="content" type="text/plain" style="width:800px;height:300px;">{yun:}$info.content{/yun}
		  </script>
		  </td>
        </tr>
        <tr >
          <th>缩 略 图：</th>
          <td>
		  <button type="button" class="yun_bth_pic noupload" lay-data="{imgid: 'imgicon'}">上传图片</button>
			
			<input type="hidden" id="laynoupload" value="1"/>

			<img id="imgicon" src="{yun:}$info.newsphoto_n{/yun}" class="admin_chlose_img_look {yun:}if !$info.newsphoto_n{/yun}none{yun:}/if{/yun}"  width="60" height="60"/>
         </tr>
        {yun:}if $property{/yun}
        <tr class="admin_table_trbg" >
          <th>类　　型：</th>
            <td> 
		      <div class="layui-form-item">
		        <div class="layui-input-block">
		          {yun:}foreach item=property_row from=$property{/yun}
		          <input name="describe[]" title="{yun:}$property_row.name{/yun}" value="{yun:}$property_row.value{/yun}" {yun:}if in_array($property_row.value,$describe){/yun} checked="checked" {yun:}/if{/yun} type="checkbox">
		        {yun:}/foreach{/yun}
		        
		        </div>
		      </div>
		    </td>
        </tr>
        {yun:}/if{/yun}
        <tr >
          <th>排　　序：</th>
          <td>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <input type="text" name="sort" id="sort"  lay-verify="required" placeholder="请输入排序" value="{yun:}$info.sort{/yun}" size="10"  autocomplete="off" class="layui-input input-text">
            </div>
          </div>
          
          </td>
        </tr>
        <tr class="admin_table_trbg" >
           <th style="border-bottom:none;">&nbsp;</th>
          <td align="left" style="border-bottom:none;"> 
            {yun:}if $info.id{/yun}
            <input type="hidden" name="id" size="40" value="{yun:}$info.id{/yun}"/>
            <input type="hidden" name="lasturl" value="{yun:}$lasturl{/yun}">
            <input type="hidden" name="updatenews" value="1">
            <input class="layui-btn layui-btn-normal" type="button" onclick="checkform()" value="&nbsp;更 新&nbsp;"  />
            {yun:}else{/yun}
            <input type="hidden" name="newsadd" value="1">
            <input class="layui-btn layui-btn-normal" type="button" onclick="checkform()" value="&nbsp;添 加&nbsp;"  />
            {yun:}/if{/yun}
            <input class="layui-btn layui-btn-normal" type="reset" name="reset" value="&nbsp;重 置 &nbsp;" /></td>
        </tr>
      </table>
	  <input type="hidden" name="pytoken" value="{yun:}$pytoken{/yun}">
    </form>
  </div>
</div>
<div id="news_preview"  style="display:none;width:560px ">
	<div style="height:300px; overflow:auto;width:560px;" >
		<div class="job_box_div" style="text-align:center;margin-top:10px;"></div>
	</div>
</div>
<style>
.layui-form-item {
    margin-bottom: 0px;
    clear: both;
}
</style>
{yun:}include file="siteadmin/checkdomain.htm"{/yun}
<script type="text/javascript">
	var ue = UE.getEditor('myEditor');
</script>
<script >
  layui.use(['layer', 'form','element'], function(){
    var layer = layui.layer
    ,form = layui.form
	,element = layui.element
    ,$ = layui.$;

  });
  </script>
  <script src="{yun:}$config.sy_weburl{/yun}/js/layui.upload.js?v={yun:}$config.cachecode{/yun}" type='text/javascript'></script>
</body>
</html>